home *** CD-ROM | disk | FTP | other *** search
/ Aminet 30 / Aminet 30 (1999)(Schatztruhe)[!][Apr 1999].iso / Aminet / gfx / misc / gnuplot-3.7src.lha / gnuplot-3.7src / gnuplot-3.7.lha / gnuplot-3.7 / buildvms.com < prev    next >
Text File  |  1998-10-29  |  6KB  |  170 lines

  1. $ ! for batch operation, set default to the gnuplot directory
  2. $ !
  3. $ ! buildvms.com
  4. $ ! Command file to compile/link gnuplot, gnuplot_x11, and make gnuplot.hlb
  5. $ !
  6. $ ! lph: modified for compatibility with VMS 4.x (which lacks 'if ... endif'),
  7. $ ! but made the default DECC
  8. $ !
  9. $! set noon
  10. $ ON ERROR THEN GOTO FINISH
  11. $!
  12. $! detect compiler - drd
  13. $! if DECC is around, assume that, else gcc is preferred. Finally vaxc
  14. $ its_decc = (f$search("SYS$SYSTEM:DECC$COMPILER.EXE") .nes. "")
  15. $ its_gnuc = 0     ! comment out the next line to use VAXC if gcc is also present 
  16. $ its_gnuc = .not.its_decc .and. (f$trnlnm("gnu_cc").nes."")
  17. $ its_vaxc = .not. (its_decc .or. its_gnuc)
  18. $ its_decw = (f$trnlnm("DECW$INCLUDE") .nes. "") 
  19. $!
  20. $! configure
  21. $
  22. $ pfix = "/prefix=all"
  23. $ rtl  = "DECCRTL"
  24. $   if .NOT. its_decc then pfix = "/nolist"
  25. $   if .NOT. its_decc then rtl  = "VAXCRTL"
  26. $!
  27. $ x11 = ""
  28. $ if its_decw then x11 = "X11,"
  29. $! 
  30. $!-----------------------------------------------------------------
  31. $!-----------------------------------------------------------------
  32. $! customize CFLAGS for version of VMS, CRTL, and C compiler.
  33. $!-----------------------------------------------------------------
  34. $!  these defines work for OpenVMS Alpha v6.2 and DEC C v5.3
  35. $ CFLAGS = "/define=(ANSI_C,HAVE_LGAMMA,HAVE_ERF,HAVE_UNISTD_H,HAVE_GETCWD,HAVE_SLEEP,"-
  36.   +"''x11'NO_GIH,PIPES,DECCRTL)''pfix'/warnings=disable=ADDRCONSTEXT"
  37. $!
  38. $!-----------------------------------------------------------------
  39. $!
  40. $! A generic starting point 
  41. $!-----------------------------------------------------------------
  42. $!
  43. $!$ CFLAGS = "/NOWARN/NOOP/DEFINE=(''x11'NO_GIH,PIPES,''rtl')''pfix'"
  44. $!
  45. $! ----------------------------------------------------------------
  46. $!
  47. $! For  VMS 4.7 and VAX C v2.4  
  48. $! ("Compiler abort - virtual memory limits exceeded" if attempt
  49. $!  to include all applicable terminals, but otherwise builds OK.  
  50. $!  Runtime problem: an exit handler error, also w/ gcc build;
  51. $!  a VAXCRTL atexit bug?)
  52. $!
  53. $! Note: VAX uses  D_FLOAT, maximum exponent ca 10e +/- 38;
  54. $!       will cause problems with some of the demos
  55. $!
  56. $!$ CFLAGS    = "/NOOP/DEFINE=(NO_STRSTR, NO_SYS_TYPES_H, "-
  57. $!               +"HAVE_GETCWD, HAVE_SLEEP, NO_LOCALE_H,"-
  58. $!               +"SHORT_TERMLIST, NO_GIH,PIPES, ''rtl')"
  59. $!$!
  60. $!
  61. $!-----------------------------------------------------------------
  62. $!
  63. $! This will build with gcc v1.42 on VMS 4.7
  64. $! (no virtual memory limit problem)
  65. $!
  66. $! gcc v1.42 string.h can prefix str routines w/ gnu_ (ifdef GCC_STRINGS)
  67. $! but the routines in GCCLIB are not prefixed w/ gcc_  :-(
  68. $! link with GCCLIB, then ignore the link warnings about multiple
  69. $! definitions of STR... in C$STRINGS
  70. $!
  71. $! GCC v1.42 has a locale.h, but neither gcc nor VMS v4.7 VAXCRTL has 
  72. $! the  setlocale function
  73. $!           
  74. $!
  75. $! Note: _assert.c defines assert_gcc, if ndef NDEBUG, but
  76. $!        cgm.trm undefines NDEBUG, so we always compile/link  _assert.c
  77. $!
  78. $!$ CFLAGS    = "/NOOP/DEFINE=(''x11'NO_STRSTR, HAVE_GETCWD,"-
  79. $!        +" HAVE_SLEEP, NO_LOCALE_H, NO_GIH, PIPES, ''rtl')"
  80. $!
  81. $!-----------------------------------------------------------------
  82. $!-----------------------------------------------------------------
  83. $!
  84. $ TERMFLAGS = "/INCLUDE=([],[.term])"
  85. $
  86. $ EXTRALIB = ""
  87. $ if its_gnuc then cc := GCC/NOCASE
  88. $ if its_gnuc then EXTRALIB = ",[]_assert,GNU_CC:[000000]GCCLIB/LIB"
  89. $
  90. $ CFLAGS="''cflags'" + "''pfix'"
  91. $ LINKOPT=""
  92. $!
  93. $ if .NOT. its_decc then -
  94.       LINKOPT=",sys$disk:[]linkopt.vms/opt"
  95. $!
  96. $!
  97. $ if its_decw then DEFINE/NOLOG X11 DECW$INCLUDE
  98. $ if its_decw then DEFINE/NOLOG SYS SYS$LIBRARY
  99. $!
  100. $ set verify
  101. $ cc 'CFLAGS' alloc.c
  102. $ cc 'CFLAGS' binary.c
  103. $ cc 'CFLAGS' bitmap.c
  104. $ cc 'CFLAGS' command.c
  105. $ cc 'CFLAGS' contour.c
  106. $ cc 'CFLAGS' datafile.c
  107. $ cc 'CFLAGS' eval.c
  108. $ cc 'CFLAGS' fit.c
  109. $ cc 'CFLAGS' graphics.c
  110. $ cc 'CFLAGS' graph3d.c
  111. $ cc 'CFLAGS' hidden3d.c
  112. $ cc 'CFLAGS' internal.c
  113. $ cc 'CFLAGS' interpol.c
  114. $ cc 'CFLAGS' matrix.c
  115. $ cc 'cflags' misc.c
  116. $ cc 'CFLAGS' parse.c
  117. $ cc 'CFLAGS' plot.c
  118. $ cc 'CFLAGS' plot2d.c
  119. $ cc 'CFLAGS' plot3d.c
  120. $ cc 'CFLAGS' scanner.c
  121. $ cc 'CFLAGS' set.c
  122. $ cc 'CFLAGS' show.c
  123. $ cc 'CFLAGS' specfun.c
  124. $ cc 'CFLAGS' standard.c
  125. $ cc 'CFLAGS' stdfn.c
  126. $ cc 'cflags' 'TERMFLAGS' term.c
  127. $ cc 'cflags' time.c
  128. $ cc 'CFLAGS' util.c
  129. $ cc 'CFLAGS' util3d.c
  130. $ cc 'CFLAGS' version.c
  131. $ cc 'CFLAGS' vms.c
  132. $ if its_gnuc then cc 'CFLAGS' GNU_CC_INCLUDE:[000000]_assert.c
  133. $!
  134. $ link/exe=gnuplot -
  135. bitmap,command,contour,eval,graphics,graph3d,vms,-
  136. binary,specfun,interpol,fit,matrix,internal,misc,parse,-
  137. plot,plot2d,plot3d,scanner,set,show,datafile,alloc,-
  138. standard,stdfn,term,util,version,util3d,hidden3d,time'extralib''LINKOPT'
  139. $!
  140. $ cc 'CFLAGS' bf_test.c
  141. $ link /exe=bf_test bf_test,binary,alloc 'extralib''LINKOPT'
  142. $ ren bf_test.exe [.demo]
  143. $ if .NOT. its_decw  then goto do_docs 
  144. $!
  145. $ CC 'CFLAGS' GPLT_X11 stdfn.c
  146. $ LINK /exe=GNUPLOT_X11 gplt_x11,stdfn 'extralib''LINKOPT',SYS$INPUT:/OPT
  147. SYS$SHARE:DECW$XLIBSHR/SHARE
  148. $!
  149. $DO_DOCS:
  150. $ SET DEF [.DOCS]
  151. $ if f$locate("ALL_TERM_DOC",CFLAGS).ne.f$length(CFLAGS) then -
  152.     copy /concatenate [-.term]*.trm []allterm.h
  153. $ cc 'CFLAGS' /OBJ=doc2rnh.obj/include=([],[-],[-.term]) doc2rnh.c 
  154. $ SET DEF [-]        ! LINKOPT is defined as being in []
  155. $ link [.docs]doc2rnh /exe=[.docs]doc2rnh 'extralib''LINKOPT'
  156. $ doc2rnh := $sys$disk:[.docs]doc2rnh
  157. $ doc2rnh [.docs]gnuplot.doc [.docs]gnuplot.rnh
  158. $ RUNOFF [.docs]gnuplot.rnh
  159. $ library/create/help sys$disk:[]gnuplot.hlb gnuplot.hlp
  160. $!
  161. $ run [.demo]bf_test
  162. $ if its_decw then -
  163.   write sys$output "%define GNUPLOT_X11 :== $Disk:[directory]GNUPLOT_X11"
  164. $!
  165. $FINISH:
  166. $ set noverify
  167. $ if its_decw then deassign x11
  168. $ exit
  169.